﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../style/css/login.css">
  <title>css3精美紫色渐变背景登录页面代码</title>
  <script src="../style/js/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script type="text/javascript">
    function login(){
      $.post("../userLoginController/login",$("#formId").serialize(),function (data){
        if(data.code==500 || data.code==201){
          alert(data.msg)
        }else{
          alert(data.msg)
          window.sessionStorage.setItem("account",data.data.account);
          window.sessionStorage.setItem("newFileName",data.data.headPortrait);
          window.sessionStorage.setItem("id",data.data.id);
          window.sessionStorage.setItem("type",data.data.state);
          window.location.replace("../front/index.html");
        }
      },"json")
    }
  </script>
</head>
<body>
  <div class="container">
    <div class="login-form">
      <div class="text">登录</div>
      <div class="form-item">
        <form id="formId">
          <input type="text" name="account" placeholder="用户名">
          <input type="password" name="password" placeholder="密码">
        </form>

      </div>
      <div class="btn" onclick="login()">登录</div>
      <div class="btn-back"></div>
      <div class="other">
        没有账号？<a href="userregister.html" >去注册</a>
      </div>
    </div>
  </div>

</body>
</html>
